<html><head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class attributes" rel=Appendix href="index_attributes.html">
<link title="Index of class methods" rel=Appendix href="index_methods.html">
<link title="Index of classes" rel=Appendix href="index_classes.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Commands" rel="Chapter" href="Commands.html">
<link title="Declaration" rel="Chapter" href="Declaration.html">
<link title="Exceptions" rel="Chapter" href="Exceptions.html">
<link title="Expressions" rel="Chapter" href="Expressions.html">
<link title="Intermediate" rel="Chapter" href="Intermediate.html">
<link title="Lexer" rel="Chapter" href="Lexer.html">
<link title="Main" rel="Chapter" href="Main.html">
<link title="Parser" rel="Chapter" href="Parser.html">
<link title="Print" rel="Chapter" href="Print.html">
<link title="Print_syntaxtree" rel="Chapter" href="Print_syntaxtree.html">
<link title="Semantic" rel="Chapter" href="Semantic.html">
<link title="Subroutines" rel="Chapter" href="Subroutines.html">
<link title="Syntaxtree" rel="Chapter" href="Syntaxtree.html">
<link title="Target" rel="Chapter" href="Target.html"><title>Print_syntaxtree.print_cmd</title>
</head>
<body>
<code class="code"><span class="keyword">let</span>&nbsp;<span class="keyword">rec</span>&nbsp;print_cmd&nbsp;(c:&nbsp;cmd)&nbsp;=&nbsp;<span class="keyword">match</span>&nbsp;c&nbsp;<span class="keyword">with</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="constructor">Ass</span>(l,r)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;&nbsp;<span class="string">"\tAss("</span>&nbsp;^&nbsp;(print_lexp&nbsp;l)&nbsp;^&nbsp;<span class="string">","</span>&nbsp;^&nbsp;(print_aexp&nbsp;r)&nbsp;^&nbsp;<span class="string">")\n"</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">|</span>&nbsp;<span class="constructor">Blk</span>(clist)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;&nbsp;<span class="string">"Blk(\n\t"</span>&nbsp;^&nbsp;(print_string_list&nbsp;(<span class="constructor">List</span>.map&nbsp;print_cmd&nbsp;clist))&nbsp;^&nbsp;<span class="string">")\n"</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">|</span>&nbsp;<span class="constructor">Ite</span>(b,c1,c2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;&nbsp;<span class="string">"\tIte("</span>&nbsp;^&nbsp;(print_bexp&nbsp;b)&nbsp;^&nbsp;<span class="string">","</span>&nbsp;^&nbsp;(print_cmd&nbsp;c1)&nbsp;^&nbsp;<span class="string">","</span>&nbsp;^&nbsp;(print_cmd&nbsp;c2)&nbsp;^&nbsp;<span class="string">")\n"</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">|</span>&nbsp;<span class="constructor">While</span>(b,c)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;&nbsp;<span class="string">"\tWhile("</span>&nbsp;^&nbsp;(print_bexp&nbsp;b)&nbsp;^&nbsp;<span class="string">","</span>&nbsp;^&nbsp;(print_cmd&nbsp;c)&nbsp;^&nbsp;<span class="string">")\n"</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">|</span>&nbsp;<span class="constructor">Repeat</span>(c,b)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;&nbsp;<span class="string">"\tRepeat("</span>&nbsp;^&nbsp;(print_cmd&nbsp;c)&nbsp;^&nbsp;<span class="string">","</span>&nbsp;^&nbsp;(print_bexp&nbsp;b)&nbsp;^&nbsp;<span class="string">")\n"</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">|</span>&nbsp;<span class="constructor">For</span>(i,ex1,ex2,c)&nbsp;&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;&nbsp;<span class="string">"\tFor("</span>&nbsp;^&nbsp;(print_ide&nbsp;i)&nbsp;^&nbsp;<span class="string">","</span>&nbsp;^&nbsp;(print_aexp&nbsp;ex1)&nbsp;^&nbsp;<span class="string">","</span>&nbsp;^&nbsp;(print_aexp&nbsp;ex2)&nbsp;^&nbsp;<span class="string">","</span>&nbsp;^&nbsp;(print_cmd&nbsp;c)&nbsp;^&nbsp;<span class="string">")\n"</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">|</span>&nbsp;<span class="constructor">Write</span>(ex)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;&nbsp;<span class="string">"\tWrite("</span>&nbsp;^&nbsp;(print_aexp&nbsp;ex)&nbsp;^&nbsp;<span class="string">")\n"</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">|</span>&nbsp;<span class="constructor">PCall</span>(id,exl)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;&nbsp;<span class="string">"\tPCall("</span>^&nbsp;(print_ide&nbsp;id)&nbsp;^<span class="string">",["</span>^&nbsp;(print_string_list&nbsp;(<span class="constructor">List</span>.map&nbsp;print_aexp&nbsp;exl))&nbsp;^<span class="string">"])\n"</span></code></body></html>